<template>
  <div>
    <x-header style="background-color:#3d82e5;width:100%;position:absolute;left:0;top:0;z-index:100;" :left-options="{showBack: true}">
      <p name="content" style="margin-left: -12px">选择省份</p>
    </x-header>
    <div style="padding-top: 38px">
      <group :title="'当前定位地区'">
        <div style="padding: 10px;width: 50px">
          <x-button mini type="default">四川</x-button>
        </div>
      </group>
      <group  :title="'A'">
        <cell v-for="itme in Alist" :title="itme.name" :value="''"  @click.native="selectaddress"></cell>
      </group>
      <group  :title="'B'">
        <cell v-for="itme in Blist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'C'">
        <cell v-for="itme in Clist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'F'">
        <cell v-for="itme in Flist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'G'">
        <cell v-for="itme in Glist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'H'">
        <cell v-for="itme in Hlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'J'">
        <cell v-for="itme in Jlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'N'">
        <cell v-for="itme in Nlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'Q'">
        <cell v-for="itme in Qlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'S'">
        <cell v-for="itme in Slist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'T'">
        <cell v-for="itme in Tlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'X'">
        <cell v-for="itme in Xlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'Y'">
        <cell v-for="itme in Ylist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
      <group  :title="'Z'">
        <cell v-for="itme in Zlist" :title="itme.name" :value="''" @click.native="selectaddress"></cell>
      </group>
    </div>
  </div>
</template>
<script>
  import { Group, XButton, Cell, XHeader } from 'vux'

  export default {
    components: {
      Group,
      XButton,
      Cell,
      XHeader
    },
    mounted: function () {
      this.weixinfn35()
    },
    data () {
      return {
        Alist: [{name: '安徽省', id: 34}],
        Blist: [{name: '北京市', id: 11}],
        Clist: [{name: '重庆市', id: 50}],
        Flist: [{name: '福建省', id: 35}],
        Glist: [{name: '广东省', id: 44}, {name: '广西壮族自治区', id: 45}, {name: '贵州省', id: 52}, {name: '甘肃省', id: 62}],
        Hlist: [{name: '河北省', id: 13}, {name: '黑龙江省', id: 23}, {name: '河南省', id: 41}, {name: '湖北省', id: 42}, {name: '湖南省', id: 43}, {name: '海南省', id: 46}],
        Jlist: [{name: '吉林省', id: 22}, {name: '江苏省', id: 32}, {name: '江西省', id: 36}],
        Nlist: [{name: '内蒙古自治区', id: 15}, {name: '宁夏回族自治区', id: 64}],
        Qlist: [{name: '青海省', id: 63}],
        Slist: [{name: '山西省', id: 14}, {name: '上海市', id: 31}, {name: '山东省', id: 37}, {name: '四川省', id: 51}, {name: '陕西省', id: 61}],
        Tlist: [{name: '天津市', id: 12}],
        Xlist: [{name: '西藏自治区', id: 54}, {name: '新疆维吾尔自治区', id: 65}],
        Ylist: [{name: '云南省', id: 53}],
        Zlist: [{name: '浙江省', id: 33}]
      }
    },
    methods: {
      selectaddress () {
        window.location.href = '/api/wxAuth/go/content+shoppingMall+ShoppingMall'
      },
      weixinfn35 () {
        let that = this
        let userId = window.sessionStorage.getItem('userId')
        let logo = window.sessionStorage.getItem('LOGO')
        let url = window.location.origin
        let link = url + '/api/wxAuth/index?type=t1' + '&uid=' + userId
        that.$wechat.onMenuShareAppMessage({
          title: '孝行通', // 分享标题
          desc: '孝行通·微商城 一个让子女为父母尽孝的老年服务平台', // 分享描述
          link: link, // 分享链接
          imgUrl: logo, // 分享图标
          success: function () {
            // 用户确认分享后执行的回调函数
          },
          cancel: function () {
            // 用户取消分享后执行的回调函数
          }
        })
        that.$wechat.onMenuShareTimeline({
          title: '孝行通', // 分享标题
          link: link, // 分享链接
          imgUrl: logo, // 分享图标
          success: function () {
            // 用户确认分享后执行的回调函数
          },
          cancel: function () {
            // 用户取消分享后执行的回调函数
          }
        })
      }
    }
  }
</script>
<style scoped="scoped">
  .table_text_tr{
    border: 1px solid #d9d9d9;
  }
</style>
